//
// Created by Ctzzz on 2024/4/28.
//

#ifndef NDKDEMO_NV21TEXTUREMAPSAMPLE_H
#define NDKDEMO_NV21TEXTUREMAPSAMPLE_H


#include "GLSampleBase.h"

class NV21TextureMapSample : public GLSampleBase {
public:
    NV21TextureMapSample(){
        m_yTextureId = GL_NONE;
        m_uvTextureId = GL_NONE;

        m_ySamplerLoc = GL_NONE;
        m_uvSamplerLoc = GL_NONE;
    };

    ~NV21TextureMapSample(){
        NativeImageUtil::FreeNativeImage(&m_RenderImage);
    };

    virtual void LoadImage(NativeImage *pImage);

    virtual void Init();

    virtual void Draw();

private:
    // y轴纹理 ID
    GLuint m_yTextureId;
    // uv轴纹理 ID
    GLuint m_uvTextureId;

    // y轴纹理采样器位置
    GLint m_ySamplerLoc;
    // uv轴纹理采样器位置
    GLint m_uvSamplerLoc;

    // 用于存储纹理图像的信息
    NativeImage m_RenderImage;
};


#endif //NDKDEMO_NV21TEXTUREMAPSAMPLE_H
